<!--
 * @Date: 2023-01-10 10:45:01
 * @LastEditTime: 2023-09-22 14:30:00
 * 介绍:
-->
<script setup lang="ts">
import { vantThemeVars, eventResetRem, preload } from "@@/common/js/init";
import pageView from "./layout/pageView.vue";
import useUserinfoStore from "@@/store/useUserinfoStore";
import { getCurrentHrefQueryParam } from "./utils/tools";
import PubSub from "pubsub-js";
import { sdk } from "@@/enum/pubsub";
import useSysStore from "./store/useSysStore";
import { changeLang } from "./hooks/sysHooks";
//字体
import "@@/assets/font/D-DINExp/D-DINExp-Bold.ttf";
import "@@/assets/font/D-DINExp/D-DINExp-Italic.ttf";
import "@@/assets/font/D-DINExp/D-DINExp.ttf";
import '@vant/touch-emulator';

onMounted(eventResetRem);
onMounted(preload);
const userinfo = useUserinfoStore();
const query = getCurrentHrefQueryParam();
const sysStore = useSysStore();
changeLang(sysStore.setting.language);

setTimeout(() => {
  userinfo.login(query);
}, 1000);
PubSub.subscribe(sdk.relogin, () => userinfo.login(query));
</script>

<template>
  <!-- vant 全局配置 -->
  <van-config-provider :theme="'dark'" :theme-vars="vantThemeVars">
    <pageView />
  </van-config-provider>
</template>

<style lang="scss">
@import "@@/common/css/effects.scss";
@import "@@/common/css/layout.scss";
@import "@@/common/css/transition.scss";
@import "@@/common/css/text.scss";
@import "@@/common/css/color.scss";
@import "@@/common/css/box.scss";
@import "@@/common/css/init.scss";
@import "@@/common/css/var.scss";
//vant 样式重置
@import "@@/common/css/vant-reset.scss";
//wangeditor 样式重置
@import "@@/common/css/wangeditor-reset.scss";
//nprogress 样式重置
@import "@@/common/css/nprogress-reset.scss";
//icon
@import "@@/assets/font-icon/icon/iconfont.css";
@import "@@/assets/font-icon/c-icon/iconfont.css";
// * 解决vant弹窗无样式的问题
@import "vant/es/dialog/index.css";
@import "vant/es/notify/index.css";
@import "vant/es/image-preview/index.css";
</style>
